package com.pxene.dmp.job;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class BaseJob {

	private final String PATH = "/data/user/shaoxiaoyu/";

	protected final int retry = 5;

	protected BufferedWriter createFileWriter(String fileName) {
		File file = new File(PATH + fileName);
		BufferedWriter writer = null;
		try {
			if (!file.exists()) {
				file.createNewFile();
			}
			writer = new BufferedWriter(new FileWriter(file), 16384);
		} catch (IOException e) {
			e.printStackTrace();
		}

		return writer;
	}

	protected void closeFileWriter(BufferedWriter writer) {
		try {
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
